package com.dmai.capacity.platform.oauth.common.service.impl;

import com.dmai.capacity.platform.common.model.Capability;
import com.dmai.capacity.platform.oauth.common.mapper.CapabilityDao;
import com.dmai.capacity.platform.oauth.common.service.ICapabilityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;


@Service
public class CapabilityServiceImpl implements ICapabilityService {

    @Autowired
    private CapabilityDao capabilityDao;

    /**
     * 添加
     *
     * @param capability
     */
    @Override
    public int save(Capability capability) {
        return capabilityDao.save(capability);
    }

    /**
     * 修改
     *
     * @param capability
     */
    @Override
    public int update(Capability capability) {
        capability.setUpdateTime(new Date());
        return capabilityDao.update(capability);
    }


    /**
     * 删除
     *
     * @param id
     */
    @Override
    public int delete(String id) {
        return capabilityDao.delete(id);
    }

    /**
     * 查询记录
     *
     * @param id
     * @return
     */
    @Override
    public Capability get(String id) {
        return capabilityDao.findById(id);
    }



    /**
     * 列表
     *
     * @param params
     * @return
     */
    @Override
    public List<Capability> findAll(Map<String, Object> params) {
        return capabilityDao.findAll(params);
    }

}
